home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
ADB.h
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
4KB
|
140 lines
/*
File: ADB.h
Contains: ADB Interface for System 8
Version: Technology:
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __ADB__
#define __ADB__
#ifndef __TYPES__
#include <Types.h>
#endif
#ifndef __IOITERATOR__
#include <IOIterator.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=power
/* the following contents can only be used by compilers that support PowerPC struct alignment */
#if FOR_SYSTEM8_PREEMPTIVE
/*
------------------------------------------------------------------------------------
Types
------------------------------------------------------------------------------------
*/
enum {
kADBCurrentIteratorDescVersion = 1
};
struct ADBIOIteratorData {
IOCommonInfo IOCI; /* common data for all families */
Byte currentAddress;
Byte defaultAddress;
Byte defaultHandlerID;
};
typedef struct ADBIOIteratorData ADBIOIteratorData;
typedef UInt32 ADBConnectionID;
struct ADBRegisterContents {
Byte data[8];
ByteCount length;
};
typedef struct ADBRegisterContents ADBRegisterContents;
/*
------------------------------------------------------------------------------------
Calls
------------------------------------------------------------------------------------
*/
extern OSStatus ADBGetDeviceData(ItemCount requestCount, ItemCount *totalCount, ADBIOIteratorData *deviceData);
extern OSStatus ADBOpen(const IODeviceRef *ref, ADBConnectionID *connection);
extern OSStatus ADBClose(ADBConnectionID connection);
extern OSStatus ADBGetNextAutopoll(ADBConnectionID connection, Duration timeOut, ADBRegisterContents *contents, AbsoluteTime *timestamp);
/* ADBGetRegister sends a Talk command over the wire*/
extern OSStatus ADBGetRegister(ADBConnectionID connection, Byte registerNumber, ADBRegisterContents *contents, AbsoluteTime *timestamp);
/*
ADBSetRegister sends a Listen command over the wire
Note, only allowed for registers 0, 1, and 2
Use the specific calls to set individual fields of register 3
*/
extern OSStatus ADBSetRegister(ADBConnectionID connection, Byte registerNumber, const ADBRegisterContents *contents);
extern OSStatus ADBGetHandlerID(ADBConnectionID connection, Byte *handlerID);
extern OSStatus ADBSetHandlerID(ADBConnectionID connection, Byte handlerID);
/*
for ADBGetStatusBits and ADBSetStatusBits,
the 4 most significant bits of the bits parameter
contain the 4 most significant bits of the first byte of device register 3
*/
extern OSStatus ADBGetStatusBits(ADBConnectionID connection, Byte *bits);
extern OSStatus ADBSetStatusBits(ADBConnectionID connection, Byte bits);
/* see the Guide to Macintosh Family Hardware for more info on an ADB device activator*/
extern OSStatus ADBTestActivator(ADBConnectionID connection, Boolean *activatorPressed);
extern OSStatus ADBFlush(ADBConnectionID connection);
extern OSStatus ADBResetBus(void );
/*
------------------------------------------------------------------------------------
status codes
------------------------------------------------------------------------------------
*/
/* ADB assigned range is -30279 to -30260 inclusive*/
enum {
adbDeviceBusyErr = -30279, /* device already Opened*/
adbInvalidConnectionIDErr = -30278,
adbConnectionTerminatedErr = -30277, /* device closed or unplugged during the call*/
adbDeviceTimeoutErr = -30276,
adbReservedHandlerIDErr = -30275,
adbInvalidHandlerIDErr = -30274
};
#endif
#pragma options align=reset
#endif /* PRAGMA_ALIGN_SUPPORTED */
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __ADB__ */